//
//  ProfileInfoController.m
//  QSBK
//
//  Created by Eric Wang on 4/24/15.
//  Copyright (c) 2015 Eric Wang. All rights reserved.
//

#import "ProfileInfoController.h"
#import "UpdateUserInfoViewController.h"
@interface ProfileInfoController ()
- (IBAction)updateUserInfo:(id)sender;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIImageView *headImage;
@property (weak, nonatomic) IBOutlet UIImageView *headImageView;
- (IBAction)back:(id)sender;

@end

@implementation ProfileInfoController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    [self configSubview];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


-(void)configSubview
{
    self.nameLabel.text = self.user.login;
    self.headImageView.backgroundColor = [UIColor colorWithRed:127/255.0 green:146/255.0 blue:254/255.0 alpha:1.0];
    [self.headImage.layer setCornerRadius:20.0];
    self.headImage.layer.masksToBounds = YES;
    self.headImage.image = self.image;
}
- (IBAction)back:(id)sender {
    
    [self dismissViewControllerAnimated:YES completion:nil];
}
- (IBAction)updateUserInfo:(id)sender {
    
    UpdateUserInfoViewController *update = [[UpdateUserInfoViewController alloc]initWithNibName:@"UpdateUserInfoViewController" bundle:nil];
    update.user = self.user;
    [self presentViewController:update animated:YES completion:nil];
}
@end
